from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django3.settings import BASE_DIR
import os
@csrf_exempt
def test_file(request):
    #10m

    test_file = request.FILES['test_file']
    file_dir = os.path.join(BASE_DIR, 'media', 'file_test',test_file.name)
    with open(file_dir,'wb+') as f:
        for i in test_file.chunks():
            f.write(i)

    return HttpResponse('hello world')